<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('server_id')->comment('服务器id');
            $table->integer('item_id')->comment('物品id');
            $table->integer('count')->default(0)->comment('物品数量');
            $table->decimal('price')->default(0)->comment('物品价格');
            $table->tinyInteger('status')->default(1)->comment('出售状态');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods');
    }
}
